
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

//{{{ file documentation -------------------------------------------------------

/*!
 * @file     mainwindow.h
 * @brief    dicodor mainwindow class declaration
 */

//}}} --------------------------------------------------------------------------
//{{{ includes / predeclarations -----------------------------------------------

// @(#) $Id:$

#include "config.h"
#include "preferences.h"
#include "textedit.h"
#include "tools.h"


#include <QtGui/QMainWindow>
#include <QtGui/QTextDocument>
#include <QtGui/QTextEdit>
#include <QtGui/QProgressDialog>

//}}} --------------------------------------------------------------------------
//{{{ namespace Ui -------------------------------------------------------------

namespace               Ui
{
	class               MainWindow;
}

//}}} --------------------------------------------------------------------------
//{{{ structures ---------------------------------------------------------------
//}}} --------------------------------------------------------------------------
//{{{ .MainWindow --------------------------------------------------------------

class MainWindow :      public QMainWindow
{
	Q_OBJECT

public:
	explicit            MainWindow( const QString & documentPath, QWidget * parent = 0 );
	virtual             ~MainWindow();

private:
	void                initTests ();
	void                initWindow ();
	void                initMenu ();
	void                initToolbar ();
	void                initConnect ();
	void                initDocument ();

	void                open( const QString& path );

private slots:
	void                on_actionPreferences_triggered ();
	void                on_actionShowMessages_triggered ();
	void                onActionPrint ();
	void                onMessage (const QString & msg);

	void                onActionConfigureFont ();
	void                onActionRunAutoSpelling ();
	void                onOrthoAutoSpellingCount (int count);
	void                onOrthoAutoSpellingAdvance (int advance);

	void                on_actionOpen_triggered ();
	void				on_actionSaveAs_triggered ();

	void				onDocumentIsEmpty (bool b);
	void				onDocumentModified (bool m);
	void				onFormatToogled (bool);

	void				on_actionHelp_triggered();

	void				onActionQuit ();
private:
	Ui::MainWindow		* ui;
	Config				* m_config;
	QToolBar			* m_toolBar;
	QString				m_documentPath;
	TextEdit			* m_edit;
	QStringList			m_messages;
	QProgressDialog		* m_progressDialog;

protected:
	void                changeEvent (QEvent * e);

};

//}}} --------------------------------------------------------------------------

#endif // MAINWINDOW_H

